package aop.common;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class SearchWordRankDAOImpl implements SearchWordRankDAO {
	@Resource(name="sqlSessionTemplate")
	private SqlSessionTemplate sqlSessionTemplate;
	
	@Override
	public int isFirstSearch(String searchWord) {
		return sqlSessionTemplate.selectOne("common.isFirstSearch",searchWord);
	}

	@Override
	public void insertSearchWord(String searchWord) {
		sqlSessionTemplate.insert("common.insertSearchWord",searchWord);
	}
	
	@Override
	public void updateSearchWord(String searchWord) {
		sqlSessionTemplate.update("common.updateSearchWord",searchWord);
	}
	
}
